//
//  PasswordValidator.m
//  liangyi
//
//  Created by 张水 on 16/12/19.
//  Copyright © 2016年 yswh. All rights reserved.
//

#import "PasswordValidator.h"

@implementation PasswordValidator

- (BOOL)validateInput:(UITextField *)input {
    if (![CommonMethod checkUserInput:input.text]) {
        self.errorMessage = @"密码不能为空";
    }else if (![CommonMethod checkPassWordIsRight:input.text]){
        self.errorMessage = @"请输入英文和数字组合,6-16位的密码";
    }else {
        self.errorMessage = nil;
    }
    
    return self.errorMessage == nil ? YES: NO;
}

@end
